# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:        潘炎珍  
# Name:         demo01
# Description:
# Author:       98745
# Date:         2019/3/10
#-------------------------------------------------------------------------------

from xml.etree.ElementTree import parse
d=parse('files/products.xml')
for item in d.iterfind('products/product'):
    id=item.findtext('id')
    name = item.findtext('name')
    price = item.findtext('price')
    print('uuid','=',item.get('uuid'))
    print('id','=',id)
    print('name','=',name)
    print('price','=',price)
    print('----------------')
